package designPatterns.P11_代理模式_Proxy.P03_cglib_runoob;

import net.sf.cglib.proxy.Enhancer;

/**
 * https://www.runoob.com/w3cnote/cglibcode-generation-library-intro.html
 *
 * @author d11yu
 */
public class P01 {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(TargetObject.class);
        enhancer.setCallback(new TargetInterceptor());
        TargetObject target = (TargetObject) enhancer.create();
        System.out.println(target);
        System.out.println(target.method1("sadfkasfd"));
        System.out.println(target.method2(100));
        System.out.println(target.method3(200));
    }
}
